package cn.net.dpi.shp.model.entity;

import cn.net.dpi.shp.handler.LineStringTypeHandler;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.locationtech.jts.geom.LineString;

import java.io.Serializable;

/**
 * @TableName bxf_cha
 */
@TableName(value = "bxf_cha")
@Data
public class BxfCha implements Serializable {
    /**
     *
     */
    @TableId
    private Integer fid;

    /**
     *
     */
    @TableField(typeHandler = LineStringTypeHandler.class)
    private LineString theGeom;

    /**
     *
     */
    private Long id;

    /**
     *
     */
    private Long formofway;

    /**
     *
     */
    private Double length;

    /**
     *
     */
    private Double speedlimit;

    /**
     *
     */
    private Long roadclass;

    /**
     *
     */
    private Long roadsubcla;

    /**
     *
     */
    private Long directiono;

    /**
     *
     */
    private Long vehiclesim;

    /**
     *
     */
    private Long istunnel;

    /**
     *
     */
    private Long isbridge;

    /**
     *
     */
    private Long istoll;

    /**
     *
     */
    private Long roadtype;

    /**
     *
     */
    private Long snodeid;

    /**
     *
     */
    private Long enodeid;

    private Long fileId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        BxfCha other = (BxfCha) that;
        return (this.getFid() == null ? other.getFid() == null : this.getFid().equals(other.getFid()))
                && (this.getTheGeom() == null ? other.getTheGeom() == null : this.getTheGeom().equals(other.getTheGeom()))
                && (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getFormofway() == null ? other.getFormofway() == null : this.getFormofway().equals(other.getFormofway()))
                && (this.getLength() == null ? other.getLength() == null : this.getLength().equals(other.getLength()))
                && (this.getSpeedlimit() == null ? other.getSpeedlimit() == null : this.getSpeedlimit().equals(other.getSpeedlimit()))
                && (this.getRoadclass() == null ? other.getRoadclass() == null : this.getRoadclass().equals(other.getRoadclass()))
                && (this.getRoadsubcla() == null ? other.getRoadsubcla() == null : this.getRoadsubcla().equals(other.getRoadsubcla()))
                && (this.getDirectiono() == null ? other.getDirectiono() == null : this.getDirectiono().equals(other.getDirectiono()))
                && (this.getVehiclesim() == null ? other.getVehiclesim() == null : this.getVehiclesim().equals(other.getVehiclesim()))
                && (this.getIstunnel() == null ? other.getIstunnel() == null : this.getIstunnel().equals(other.getIstunnel()))
                && (this.getIsbridge() == null ? other.getIsbridge() == null : this.getIsbridge().equals(other.getIsbridge()))
                && (this.getIstoll() == null ? other.getIstoll() == null : this.getIstoll().equals(other.getIstoll()))
                && (this.getRoadtype() == null ? other.getRoadtype() == null : this.getRoadtype().equals(other.getRoadtype()))
                && (this.getSnodeid() == null ? other.getSnodeid() == null : this.getSnodeid().equals(other.getSnodeid()))
                && (this.getEnodeid() == null ? other.getEnodeid() == null : this.getEnodeid().equals(other.getEnodeid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getFid() == null) ? 0 : getFid().hashCode());
        result = prime * result + ((getTheGeom() == null) ? 0 : getTheGeom().hashCode());
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getFormofway() == null) ? 0 : getFormofway().hashCode());
        result = prime * result + ((getLength() == null) ? 0 : getLength().hashCode());
        result = prime * result + ((getSpeedlimit() == null) ? 0 : getSpeedlimit().hashCode());
        result = prime * result + ((getRoadclass() == null) ? 0 : getRoadclass().hashCode());
        result = prime * result + ((getRoadsubcla() == null) ? 0 : getRoadsubcla().hashCode());
        result = prime * result + ((getDirectiono() == null) ? 0 : getDirectiono().hashCode());
        result = prime * result + ((getVehiclesim() == null) ? 0 : getVehiclesim().hashCode());
        result = prime * result + ((getIstunnel() == null) ? 0 : getIstunnel().hashCode());
        result = prime * result + ((getIsbridge() == null) ? 0 : getIsbridge().hashCode());
        result = prime * result + ((getIstoll() == null) ? 0 : getIstoll().hashCode());
        result = prime * result + ((getRoadtype() == null) ? 0 : getRoadtype().hashCode());
        result = prime * result + ((getSnodeid() == null) ? 0 : getSnodeid().hashCode());
        result = prime * result + ((getEnodeid() == null) ? 0 : getEnodeid().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", fid=").append(fid);
        sb.append(", theGeom=").append(theGeom);
        sb.append(", id=").append(id);
        sb.append(", formofway=").append(formofway);
        sb.append(", length=").append(length);
        sb.append(", speedlimit=").append(speedlimit);
        sb.append(", roadclass=").append(roadclass);
        sb.append(", roadsubcla=").append(roadsubcla);
        sb.append(", directiono=").append(directiono);
        sb.append(", vehiclesim=").append(vehiclesim);
        sb.append(", istunnel=").append(istunnel);
        sb.append(", isbridge=").append(isbridge);
        sb.append(", istoll=").append(istoll);
        sb.append(", roadtype=").append(roadtype);
        sb.append(", snodeid=").append(snodeid);
        sb.append(", enodeid=").append(enodeid);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}